import Router from 'koa-router'
import config from '../config'
import wechatMiddle from '../wechat-lib/middleware'
import { hello } from '../controllers/hello'

export const router = app => {
  const router = new Router()
  router.all('/wechat-hear', wechatMiddle(config.wechat))
  router.get('/hello',  hello);

  app
    .use(router.routes())
    .use(router.allowedMethods())
}
